package com.shiguiwu.springmybatis.spring.lifecycle.init;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;

/**
 * @description: 9.1初始化-aware接口回调
 * @author: stone
 * @date: Created by 2021/3/28 11:51
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.spring.lifecycle.init
 */
public class AwareTests {

    public static void main(String[] args) {
        DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
        BeanDefinition beanDefinition = BeanDefinitionBuilder.genericBeanDefinition(MyAware.class).getBeanDefinition();
        factory.registerBeanDefinition("myAware", beanDefinition);
        System.out.println(factory.getBean(MyAware.class));

    }

}
